package behavior.command;

import java.util.ArrayList;
import java.util.List;

/**
 * @author dali
 * @date 2021-07-22 17:11
 * @Description 机器人调用者
 */

public class RobotInvoker implements Command{
    private final List<Command> commands = new ArrayList<>();

    public void addCommand(Command command) {
        commands.add(command);
    }

    @Override
    public void execute() {
        for (Command c : commands) {
            c.execute();
        }
    }
}
